package com.xiangxiao.rpan.authority.dao;

import com.xiangxiao.rpan.authority.dto.TopicUserRelatedDto;
import com.xiangxiao.rpan.authority.model.AuthModuleInfo;
import com.xiangxiao.rpan.authority.vo.TopicVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2024/7/2 16:27
 */
public interface TopicMapper {
  /**
   * 查询登录用户的权限
   *
   * @param topic
   * @return
   */
  List<String> findUsersBytopic(@Param("topic") String topic);

  /**
   * 查询所有的告警topics列表
   * */
  List<TopicVo> getAllTopics();


  /**
   * 查询所有的topicId-userId对应中间表的数据
   * */
  List<TopicUserRelatedDto> getllTopicRelatedUsers();

  /**
   * 往t_user_topic关联中间表里添加记录
   * */
  Integer insertTopicUserRelated(TopicUserRelatedDto dto);

  /**
   * 据topic-id删除t_user_topic关联中间表里的记录
   * */
  int deleteByTopicId(@Param("topicId") Integer topicId);
}
